package org.dyndns.opendemogroup.optimizer;

import java.util.EventObject;

/**
 * Convenience class for OptimizationListener implementations.
 */
public class OptimizationEvent extends EventObject
{
	// { private fields
	private int run;

	private int gen;

	private Member bestMember;

	private int populationIndex;

	private RunResult runResult;

	// }

	public OptimizationEvent ( GenericGenerationalGeneticAlgorithm source )
	{
		super ( source );
	}

	private static final long serialVersionUID = 395117433026360500L;

	public GenericGenerationalGeneticAlgorithm getEngine ( )
	{
		return (GenericGenerationalGeneticAlgorithm) source;
	}

	// { accessors
	public int getRun ( )
	{
		return run;
	}

	public void setRun ( int run )
	{
		this.run = run;
	}

	public int getGen ( )
	{
		return gen;
	}

	public void setGen ( int gen )
	{
		this.gen = gen;
	}

	public Member getBestMember ( )
	{
		return bestMember;
	}

	public void setBestMember ( Member bestMember )
	{
		this.bestMember = bestMember;
	}

	public int getPopulationIndex ( )
	{
		return populationIndex;
	}

	public void setPopulationIndex ( int populationIndex )
	{
		this.populationIndex = populationIndex;
	}

	public RunResult getRunResult ( )
	{
		return runResult;
	}

	public void setRunResult ( RunResult result )
	{
		this.runResult = result;
	}
	// }
}
